package com.ax.business.common.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ax.business.common.annotation.Log;
import com.ax.business.common.service.MakeOrderService;
import com.ax.business.common.util.AjaxRes;
import com.ax.business.common.util.Const;

@Controller
public class MakeOrderController {
	@Autowired
	MakeOrderService makeOrderService;
	
	/**
	 * 看医生开处方(模块:生成单号)
	 * 
	 * @param businessCode
	 *           
	 * @return String
	 */
	@Log("生成单据号")
	@RequestMapping("/getMakeOrder")
	@ResponseBody
	public AjaxRes getMakeOrder(AjaxRes ajaxRes,String businessCode,String sessionId,HttpServletRequest request){
		try {
			String order = makeOrderService.getMakeOrderSer(businessCode);
			ajaxRes.setSucceed(order,Const.DATA_SUCCEED);
		} catch (Exception e){
			ajaxRes.setFailMsg(e.getMessage());
		}
		return ajaxRes;
	}
	
	
}
